<template>
    <view class="page">
        <!-- 订单tab -->
        <view class="order-tab">
            <view class="tab" :class="{'action':OrderType==0}" @click="onOrderTab(0)">
                <text>售后申请</text>
                <text class="line"></text>
            </view>
            <view class="tab" :class="{'action':OrderType==1}" @click="onOrderTab(1)">
                <text>处理中</text>
                <text class="line"></text>
            </view>
            <view class="tab" :class="{'action':OrderType==2}" @click="onOrderTab(2)">
                <text>售后评价</text>
                <text class="line"></text>
            </view>
            <view class="tab" :class="{'action':OrderType==3}" @click="onOrderTab(3)">
                <text>申请记录</text>
                <text class="line"></text>
            </view>
        </view>
        <!-- 订单搜索 -->
        <view class="order-search">
            <view class="search">
                <text class="iconfont icon-fadajing"></text>
                <input type="text" placeholder="商品名称/商品编号/订单号/序列号">
            </view>
            <view class="filtrate" @click="isFiltrate = true">
                <text>筛选</text>
            </view>
        </view>
        <!-- 订单列表 -->
        <view class="order-list">
            <view class="list">
                <view class="order-number">
                    <view class="number">
                        <text>服务单号：621912345678</text>
                    </view>
                    <view class="type">
                        // <image src="/static/sale_th.png" mode=""></image>
                        <text>退货</text>
                    </view>
                </view>
                <view class="goods-list">
                    <view class="list">
                        <view class="thumb">
                            <image src="/static/img/souji.webp" mode=""></image>
                        </view>
                        <view class="item">
                            <view class="title">
                                <text class="two-omit">荣耀20青春版 AMOLED屏幕指纹 4000mAh大电池 20W快充 4800万 手机 4GB+64GB 冰岛幻境</text>
                            </view>
                            <view class="num">
                                <text>申请数量：1</text>
                            </view>
                        </view>
                    </view>
                </view>
                <view class="order-status" v-if="OrderType != 0">
                    <text>审核中</text>
                    <text>当前订单退货审核中</text>
                </view>
                <view class="order-btn" v-if="OrderType === 0">
                    <text class="action">申请售后</text>
                </view>
            </view>
        </view>
        <!-- 筛选弹窗 -->
        <view class="filtrate-win" @click="isFiltrate = false">
            <view class="cu-modal drawer-modal justify-end" :class="{'show':isFiltrate}">
                <view class="cu-dialog basis-lg">
                    <view class="order-time">
                        <view class="title">
                            <text>下单时间</text>
                        </view>
                        <view class="time-list">
                            <view class="list action">
                                <text>全部</text>
                            </view>
                            <view class="list">
                                <text>一个月内</text>
                            </view>
                            <view class="list">
                                <text>一个月至三个月</text>
                            </view>
                            <view class="list">
                                <text>三个月六个月</text>
                            </view>
                            <view class="list">
                                <text>六个月至一年</text>
                            </view>
                            <view class="list">
                                <text>一年以上</text>
                            </view>
                        </view>
                    </view>
                    <view class="footer-btn">
                        <view class="btn" @click="isFiltrate = false">
                            <text>重置</text>
                        </view>
                        <view class="btn action" @click="isFiltrate = false">
                            <text>确定</text>
                        </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            OrderType: 0,
            isFiltrate: false,
        };
    },
    methods: {
        /**
         * 订单tab切换状态
         * @param {Number} type
         */
        onOrderTab(type) {
            this.OrderType = type;
        }
    }
}
</script>

<style scoped lang="scss">
.page {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #f6f6f6;
}

/* 订单tab */
.order-tab {
    position: fixed;
    left: 0;
    top: 0;
    /* #ifdef H5 */
    top: 88rpx;
    /* #endif */
    z-index: 10;
    display: flex;
    align-items: center;
    width: 100%;
    height: 100rpx;
    background-color: #ffffff;
    .tab {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 205%;
        height: 80%;
        text {
            font-size: 26rpx;
            color: #959595;
        }
    }
    .action {
        text {
            color: #222222;
        }
        .line {
            position: absolute;
            left: 50%;
            bottom: 0;
            width: 60rpx;
            height: 6rpx;
            background: linear-gradient(to right, $base, #f6f6f6);
            transform: translate(-50%, 0);
        }
    }
}

/* 售后申请 */
.order-search {
    display: flex;
    align-items: center;
    padding: 0 4%;
    height: 80rpx;
    background-color: #ffffff;
    margin-top: 100rpx;
    .search {
        display: flex;
        align-items: center;
        width: 90%;
        height: 60rpx;
        background-color: #f6f6f6;
        border-radius: 70rpx;
        padding: 0 20rpx;
        text {
            font-size: 32rpx;
            color: #555555;
        }
        input {
            width: 90%;
            height: 100%;
            font-size: 26rpx;
            color: #555555;
            margin-left: 3%;
        }
    }
    .filtrate {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        width: 10%;
        height: 100%;
        text {
            font-size: 26rpx;
            color: #959595;
        }
    }
}

/* 订单列表 */
.order-list {
    width: 100%;
    margin: 20rpx auto;
    .list {
        padding: 20rpx 4%;
        background-color: #ffffff;
        border-radius: 20rpx;
        margin-bottom: 20rpx;
        .order-number {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            height: 60rpx;
            .number {
                display: flex;
                align-items: center;
                text {
                    font-size: 26rpx;
                    color: #959595;
                }
            }
            .type {
                display: flex;
                align-items: center;
                image {
                    width: 34rpx;
                    height: 34rpx;
                }
                text {
                    font-size: 26rpx;
                    font-weight: bold;
                    color: #222222;
                    margin-left: 10rpx;
                }
            }
        }
        .goods-list {
            width: 100%;
            height: 200rpx;
            .list {
                display: flex;
                align-items: center;
                width: 100%;
                height: 200rpx;
                .thumb {
                    display: flex;
                    align-items: center;
                    width: 30%;
                    height: 100%;
                    image {
                        width: 160rpx;
                        height: 160rpx;
                    }
                }
                .item {
                    width: 70%;
                    height: 100%;
                    .title {
                        display: flex;
                        align-items: center;
                        width: 100%;
                        height: 120rpx;
                        text {
                            color: #222222;
                            font-size: 26rpx;
                        }
                    }
                    .num {
                        display: flex;
                        width: 100%;
                        text {
                            color: #959595;
                            font-size: 26rpx;
                        }
                    }
                }
            }
        }
        .order-status {
            display: flex;
            align-items: center;
            padding: 0 4%;
            height: 100rpx;
            background-color: #f6f6f6;
            border-radius: 20rpx;
            text {
                font-size: 28rpx;
                color: #959595;
            }
            text:nth-child(1) {
                color: #222222;
                margin-right: 20rpx;
            }
        }
        .order-btn {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            width: 100%;
            height: 100rpx;
            background-color: #ffffff;
            text {
                padding: 10rpx 30rpx;
                font-size: 26rpx;
                color: #959595;
                border: 2rpx solid #eeeeee;
                border-radius: 100rpx;
            }
            .action {
                border: 2rpx solid $base;
                color: $base;
            }
        }
    }
}

/* 筛选弹窗 */
.filtrate-win {
    .cu-dialog {
        top: 0;
        height: calc(100vh);
        flex-basis: 90% !important;
        background-color: #ffffff;
        // 下单时间
        .order-time {
            padding: 0 4%;
            .title {
                display: flex;
                align-items: center;
                width: 100%;
                height: 100rpx;
                text {
                    font-size: 28rpx;
                    color: #222222;
                }
            }
            .time-list {
                display: flex;
                flex-wrap: wrap;
                justify-content: space-between;
                width: 100%;
                .list {
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    width: 48%;
                    height: 60rpx;
                    background-color: #f6f6f6;
                    border: 2rpx solid #ffffff;
                    border-radius: 60rpx;
                    margin-bottom: 20rpx;
                    text {
                        font-size: 26rpx;
                        color: #222222;
                    }
                }
                .action {
                    background-color: $rgba-02;
                    border: 2rpx solid $base;
                    text {
                        color: $base;
                    }
                }
            }
        }
        // 按钮
        .footer-btn {
            position: absolute;
            left: 0;
            bottom: 0;
            display: flex;
            align-items: center;
            width: 100%;
            height: 100rpx;
            border-top: 2rpx solid #f6f6f6;
            .btn {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 50%;
                height: 100%;
                text {
                    font-size: 28rpx;
                    color: #555555;
                }
            }
            .action {
                background: linear-gradient(to right, $base, $change-clor);
                text {
                    color: #ffffff;
                }
            }
        }
    }
}
</style>
